#Boa:Dialog:Dialog1

import wx

def create(parent):
    return Dialog1(parent)

[wxID_DIALOG1, wxID_DIALOG1BUTTON1, wxID_DIALOG1BUTTON10, 
 wxID_DIALOG1BUTTON11, wxID_DIALOG1BUTTON12, wxID_DIALOG1BUTTON13, 
 wxID_DIALOG1BUTTON2, wxID_DIALOG1BUTTON3, wxID_DIALOG1BUTTON4, 
 wxID_DIALOG1BUTTON5, wxID_DIALOG1BUTTON6, wxID_DIALOG1BUTTON7, 
 wxID_DIALOG1BUTTON8, wxID_DIALOG1BUTTON9, wxID_DIALOG1PANEL1, 
 wxID_DIALOG1TEXTCTRL1, 
] = [wx.NewId() for _init_ctrls in range(16)]

class Dialog1(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DIALOG1, name='', parent=prnt,
              pos=wx.Point(748, 95), size=wx.Size(320, 489),
              style=wx.DEFAULT_DIALOG_STYLE, title='Ingreso Manual')
        self.SetClientSize(wx.Size(312, 462))

        self.panel1 = wx.Panel(id=wxID_DIALOG1PANEL1, name='panel1',
              parent=self, pos=wx.Point(0, 0), size=wx.Size(392, 472),
              style=wx.TAB_TRAVERSAL)

        self.textCtrl1 = wx.TextCtrl(id=wxID_DIALOG1TEXTCTRL1, name='textCtrl1',
              parent=self.panel1, pos=wx.Point(24, 16), size=wx.Size(264, 32),
              style=0, value='')
        self.textCtrl1.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Arial'))
        self.textCtrl1.Bind(wx.EVT_PAINT, self.OnTextCtrl1Paint)

        self.button1 = wx.Button(id=wxID_DIALOG1BUTTON1, label='1',
              name='button1', parent=self.panel1, pos=wx.Point(24, 56),
              size=wx.Size(88, 80), style=0)
        self.button1.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button,
              id=wxID_DIALOG1BUTTON1)

        self.button2 = wx.Button(id=wxID_DIALOG1BUTTON2, label='2',
              name='button2', parent=self.panel1, pos=wx.Point(112, 56),
              size=wx.Size(88, 80), style=0)
        self.button2.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button,
              id=wxID_DIALOG1BUTTON2)

        self.button3 = wx.Button(id=wxID_DIALOG1BUTTON3, label='3',
              name='button3', parent=self.panel1, pos=wx.Point(200, 56),
              size=wx.Size(88, 80), style=0)
        self.button3.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button3.Bind(wx.EVT_BUTTON, self.OnButton3Button,
              id=wxID_DIALOG1BUTTON3)

        self.button4 = wx.Button(id=wxID_DIALOG1BUTTON4, label='4',
              name='button4', parent=self.panel1, pos=wx.Point(24, 136),
              size=wx.Size(88, 80), style=0)
        self.button4.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button4.Bind(wx.EVT_BUTTON, self.OnButton4Button,
              id=wxID_DIALOG1BUTTON4)

        self.button5 = wx.Button(id=wxID_DIALOG1BUTTON5, label='5',
              name='button5', parent=self.panel1, pos=wx.Point(112, 136),
              size=wx.Size(88, 80), style=0)
        self.button5.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button5.Bind(wx.EVT_BUTTON, self.OnButton5Button,
              id=wxID_DIALOG1BUTTON5)

        self.button6 = wx.Button(id=wxID_DIALOG1BUTTON6, label='6',
              name='button6', parent=self.panel1, pos=wx.Point(200, 136),
              size=wx.Size(88, 80), style=0)
        self.button6.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button6.Bind(wx.EVT_BUTTON, self.OnButton6Button,
              id=wxID_DIALOG1BUTTON6)

        self.button7 = wx.Button(id=wxID_DIALOG1BUTTON7, label='7',
              name='button7', parent=self.panel1, pos=wx.Point(24, 216),
              size=wx.Size(88, 80), style=0)
        self.button7.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button7.Bind(wx.EVT_BUTTON, self.OnButton7Button,
              id=wxID_DIALOG1BUTTON7)

        self.button8 = wx.Button(id=wxID_DIALOG1BUTTON8, label='8',
              name='button8', parent=self.panel1, pos=wx.Point(112, 216),
              size=wx.Size(88, 80), style=0)
        self.button8.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button8.Bind(wx.EVT_BUTTON, self.OnButton8Button,
              id=wxID_DIALOG1BUTTON8)

        self.button9 = wx.Button(id=wxID_DIALOG1BUTTON9, label='9',
              name='button9', parent=self.panel1, pos=wx.Point(200, 216),
              size=wx.Size(88, 80), style=0)
        self.button9.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button9.Bind(wx.EVT_BUTTON, self.OnButton9Button,
              id=wxID_DIALOG1BUTTON9)

        self.button10 = wx.Button(id=wxID_DIALOG1BUTTON10, label='0',
              name='button10', parent=self.panel1, pos=wx.Point(112, 296),
              size=wx.Size(88, 72), style=0)
        self.button10.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button10.Bind(wx.EVT_BUTTON, self.OnButton0Button,
              id=wxID_DIALOG1BUTTON10)

        self.button11 = wx.Button(id=wxID_DIALOG1BUTTON11, label='-',
              name='button11', parent=self.panel1, pos=wx.Point(24, 296),
              size=wx.Size(88, 72), style=0)
        self.button11.SetFont(wx.Font(36, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))
        self.button11.Bind(wx.EVT_BUTTON, self.OnButtonGuion,
              id=wxID_DIALOG1BUTTON11)

        self.button13 = wx.Button(id=wxID_DIALOG1BUTTON13, label='DEL',
              name='button13', parent=self.panel1, pos=wx.Point(200, 296),
              size=wx.Size(88, 72), style=0)
        self.button13.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Arial'))
        self.button13.Bind(wx.EVT_BUTTON, self.OnButtonDelete,
              id=wxID_DIALOG1BUTTON13)

        self.button12 = wx.Button(id=wxID_DIALOG1BUTTON12, label='ENTRAR',
              name='button12', parent=self.panel1, pos=wx.Point(24, 376),
              size=wx.Size(264, 64), style=0)
        self.button12.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Arial'))
        self.button12.Bind(wx.EVT_BUTTON, self.OnButtonEntrar,
              id=wxID_DIALOG1BUTTON12)

    def __init__(self, parent, contenido):
        self._init_ctrls(parent)
        self.valor = contenido
        self.textCtrl1.SetValue(contenido)

    def OnButton1Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "1"
        self.textCtrl1.SetValue(texto)

    def OnButton2Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "2"
        self.textCtrl1.SetValue(texto)

    def OnButton3Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "3"
        self.textCtrl1.SetValue(texto)

    def OnButton4Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "4"
        self.textCtrl1.SetValue(texto)

    def OnButton5Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "5"
        self.textCtrl1.SetValue(texto)

    def OnButton6Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "6"
        self.textCtrl1.SetValue(texto)

    def OnButton7Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "7"
        self.textCtrl1.SetValue(texto)

    def OnButton8Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "8"
        self.textCtrl1.SetValue(texto)

    def OnButton9Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "9"
        self.textCtrl1.SetValue(texto)

    def OnButtonGuion(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "-"
        self.textCtrl1.SetValue(texto)

    def OnButton0Button(self, event):
        texto = self.textCtrl1.GetValue()
        texto = texto + "0"
        self.textCtrl1.SetValue(texto)

    def OnButtonDelete(self, event):
        texto = self.textCtrl1.GetValue()
        if texto == "": 
            return 0
        texto = texto[0:-1]
        self.textCtrl1.SetValue(texto)

    def OnButtonEntrar(self, event):
        self.valor = self.textCtrl1.GetValue()
        self.Close()

    def OnTextCtrl1Paint(self, event):
        if self.textCtrl1.GetValue() != "":
            self.OnButtonEntrar(event)
        event.Skip()
